package com.duobaoyu.dby.supply.biz.client.resource.bean.dto;

import com.duobaoyu.dby.common.core.validator.groups.Add;
import com.duobaoyu.dby.common.core.validator.groups.Edit;
import com.duobaoyu.dby.common.mybatis.support.Query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @className: DictionaryDTO
 * @description: 字典表
 * @author: lyy
 * @createDate: 2022-06-23 9:45
 * @Version: 1.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Dictionary对象", description = "字典表")
public class DictionaryDTO extends Query implements Serializable {

	private static final long serialVersionUID = 3078103750998416456L;
	/**
	 * 字典ID
	 */
	@ApiModelProperty(value = "字典ID")
	@NotNull(message = "字典ID不可为空", groups = Edit.class)
	private Long id;
	/**
	 * 字典名称
	 */
	@NotBlank(message = "字典名称不可为空", groups = {Add.class, Edit.class})
	@ApiModelProperty(value = "字典名称")
	private String dictionaryName;
	/**
	 * 字典编码
	 */
	@NotBlank(message = "字典编码不可为空", groups = {Add.class, Edit.class})
	@ApiModelProperty(value = "字典编码")
	private String dictionaryCode;
	/**
	 * 字典类型0为string,1为number
	 */
	@NotNull(message = "字典类型不可为空", groups = {Add.class, Edit.class})
	@ApiModelProperty(value = "字典类型0为string,1为number")
	private Integer type;
	/**
	 * 字典描述
	 */
	@ApiModelProperty(value = "字典描述")
	private String description;
	/**
	 * 字典项数据
	 */
	@ApiModelProperty(value = "字典项数据")
	@Valid
	private List<DictionaryItemDTO> dictionaryItems;
}
